ALL = Log.out mysql.out json.out split.out read.out db.out room.out session.out
cc = g++
CFLAGS = -I../source -std=c++11 -DDBG

.PHONY:all
all:${ALL}

.PHONY:mysql
mysql:mysql.out

.PHONY:Log
Log:Log.out

.PHONY:json
json:json.out

.PHONY:split
split:split.out

.PHONY:read
read:read.out

.PHONY:db
db:db.out

.PHONY:room
room:room.out

.PHONY:session
session:session.out

session.out:session.cc ../source/session.hpp 
	${cc} -o $@ $< $(CFLAGS) -L/lib64/mysql/ -lmysqlclient -ljsoncpp -lboost_system

room.out:room.cc ../source/room.hpp ../source/online.hpp
	${cc} -o $@ $< $(CFLAGS) -L/lib64/mysql/ -lmysqlclient -ljsoncpp -lboost_system

db.out:db.cc ../source/db.hpp
	${cc} -o $@ $< $(CFLAGS) -L/lib64/mysql/ -lmysqlclient -ljsoncpp

read.out:file_read.cc ../source/file_util.hpp
	${cc} -o $@ $< $(CFLAGS)

split.out:string_split.cc ../source/string_util.hpp
	${cc} -o $@ $< $(CFLAGS)

json.out:json.cc ../source/json_util.hpp
	${cc} -o $@ $< $(CFLAGS) -ljsoncpp

mysql.out:mysql.cc ../source/mysql_util.hpp
	${cc} -o $@ $< $(CFLAGS) -L/lib64/mysql/ -lmysqlclient

Log.out:Log.cc ../source/Log.hpp
	${cc} -o $@ $< $(CFLAGS)


.PHONY:clean
clean:
	rm -f ${ALL}